package com.dcbeida.model;

import android.util.Log;

import com.dcbeida.utils.GenApiHashUrl;

import dc.medicine.com.okhttplib.OkHttpUtils;
import dc.medicine.com.okhttplib.callback.AbsCallback;

/**
 * Created by hp on 2016/7/27.
 */
public class ModelUtils {

    private static ModelUtils mCommModel;

    private ModelUtils() {

    }

    public static ModelUtils newInstance() {
        if (mCommModel == null) {
            return new ModelUtils();
        } else {
            return mCommModel;
        }
    }

    public void getDate(String service, String params, AbsCallback mAbsCallback) {
        Log.d("swt","service = "+service+"\n"+"params = "+params);
        OkHttpUtils.getInstance().post(GenApiHashUrl.apiUrl).tag(this)
                .paramsApp("service", service)
                .paramsApp("params", params).execute(mAbsCallback);
    }

    public void getCancel() {
        OkHttpUtils.getInstance().cancelTag(this);
    }
}
